home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 85 / CD Temático 40 Febrero 2004.iso / DOS / testdisk / src / intrface.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-01-09  |  5.1 KB  |  119 lines

  1. /*
  2.  
  3.     File: intrface.h
  4.  
  5.     Copyright (C) 1998-2004 Christophe GRENIER <grenier@cgsecurity.org>
  6.   
  7.     This software is free software; you can redistribute it and/or modify
  8.     it under the terms of the GNU General Public License as published by
  9.     the Free Software Foundation; either version 2 of the License, or
  10.     (at your option) any later version.
  11.   
  12.     This program is distributed in the hope that it will be useful,
  13.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.     GNU General Public License for more details.
  16.   
  17.     You should have received a copy of the GNU General Public License
  18.     along with this program; if not, write to the Free Software
  19.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21.  */
  22. /* Constants for menuType parameter of menuSelect function */
  23. #define MENU_HORIZ 1
  24. #define MENU_VERT 2
  25. #define MENU_ACCEPT_OTHERS 4
  26. #define MENU_BUTTON 8
  27. /* Miscellenous constants */
  28. #define MENU_SPACING 2
  29. #define MENU_MAX_ITEMS 256 /* for simpleMenu function */
  30. #define MENU_UP 1
  31. #define MENU_DOWN 2
  32. #define MENU_RIGHT 3
  33. #define MENU_LEFT 4
  34.  
  35. struct MenuItem
  36. {
  37.     const int key; /* Keyboard shortcut; if zero, then there is no more items in the menu item table */
  38.     const char *name; /* Item name, should be eight characters with current implementation */
  39.     const char *desc; /* Item description to be printed when item is selected */
  40. };
  41.  
  42. #define LINE_LENGTH 80
  43. #define BUFFER_LINE_LENGTH 4*LINE_LENGTH
  44. #define MAXIMUM_PARTS 60
  45. #define COL_ID_WIDTH 25
  46. #define WARNING_START 23
  47. #define COLUMNS 80
  48.  
  49. #define key_CR '\015'
  50. #define key_ESC '\033'
  51. #define key_DEL '\177'
  52. #define key_BELL '\007'
  53. /* '\014' == ^L */
  54. #define key_REDRAWKEY '\014'
  55.  
  56.  
  57. #define INTER_ADV_X    0
  58. #define INTER_ADV_Y    23
  59. #define INTER_MAIN_X    0
  60. #define INTER_MAIN_Y    18
  61. #define COMMAND_LINE_X    0
  62. #define COMMAND_LINE_Y  18
  63. #define INTER_OPTION_X  0
  64. #define INTER_OPTION_Y    10
  65. #define ANALYSE_X    0
  66. #define ANALYSE_Y    5
  67. #define DUMP_X    0
  68. #define DUMP_Y    ANALYSE_Y + 2
  69. #define DUMP_MAX_LINES    15
  70. #define INTER_DUMP_X    DUMP_X
  71. #define INTER_DUMP_Y    DUMP_Y+DUMP_MAX_LINES
  72. #define INTER_STRUCTURE    14
  73. #define INTER_ADV    15
  74.  
  75. int menuUpdate( int y, int x, const struct MenuItem *menuItems, const unsigned int itemLength, const char *available, const int menuType, unsigned int current );
  76. int wmenuUpdate(WINDOW *window, int y, int x, const struct MenuItem *menuItems, const unsigned int itemLength, const char *available, const int menuType, unsigned int current);
  77. int wmenuSelect(WINDOW *window, int y, int x, struct MenuItem *menuItems, const unsigned int itemLength, const char *available, int menuType, unsigned int menuDefault);
  78. int wmenuSimple(WINDOW *window,struct MenuItem *menuItems, int menuDefault);
  79. void change_geometry(t_param_disk *disk_car);
  80. int do_curses_testdisk(int debug,int paranoid, int dump_ind, int fast_mode, int align,int do_analyse, const t_list_disk *list_disk);
  81. int interface_write(t_param_disk *disk_car,t_list_part *list_part,const int can_search_deeper);
  82. void dump(WINDOW *window,const void *nom_dump,unsigned int lng);
  83. void dump2(WINDOW *window,const void *dump_1, const void *dump_2,const unsigned int lng);
  84. int wgetch_nodelay(WINDOW *window);
  85.  
  86. enum buffer_cmd {BUFFER_RESET, BUFFER_ADD, BUFFER_DISPLAY, BUFFER_WRITE,BUFFER_SHOW};
  87. typedef enum buffer_cmd buffer_cmd_t;
  88.  
  89. #define MAX_LINES    200
  90. /* int aff_buffer(const int cmd, const char *_format, ...) __attribute__ ((format (printf, 2, 3))); */
  91. int aff_buffer(const buffer_cmd_t cmd, const char *_format, ...);
  92. void aff_LBA2CHS(const t_param_disk *disk_car, const dword pos_LBA);
  93. void aff_LBA2CHS_rapport(const t_param_disk *disk_car, const dword pos_LBA);
  94. /*
  95. void aff_disk(WINDOW *window,const t_param_disk *param_disk);
  96. void aff_disk_rapport(const t_param_disk *param_disk);
  97. void aff_disk_classic(const t_param_disk *param_disk);
  98. */
  99. void aff_CHS_rapport(const t_CHS * CHS);
  100. void aff_CHS(const t_CHS * CHS);
  101. void aff_CHS_buffer(const t_CHS * CHS);
  102. void aff_entry(const struct partition_dos*);
  103. void aff_entry_rapport(const struct partition_dos*);
  104. void aff_part_buffer(const aff_part_type_t newline,const t_param_disk *disk_car,const t_diskext *partition);
  105. void aff_part(WINDOW *window,const aff_part_type_t newline,const t_param_disk *disk_car,const t_diskext *partition);
  106. void aff_part_rapport(const t_param_disk *disk_car,const t_diskext *partition);
  107. t_list_part *ask_structure(t_param_disk *disk_car,t_list_part *list_part, const int debug);
  108. void aff_copy(WINDOW *window);
  109. void aff_copy_full(WINDOW *window);
  110. void interface_analyse(t_param_disk *disk_car, const int debug);
  111. void interface_list(t_param_disk *disk_car, const int debug,const int test_recovery);
  112. int ask_confirmation(const char*msg);
  113. unsigned int ask_number(const unsigned int val_cur, const unsigned int val_min, const unsigned int val_max, const char * _format, ...);
  114. t_list_part *add_partition(t_param_disk *disk_car,t_list_part *list_part, const int debug);
  115. int display_message(const char*msg);
  116. int get_string(char *str, int len, char *def);
  117. void interface_editor(t_param_disk *disk_car);
  118. int change_part_type(const t_param_disk *disk_car,t_diskext *partition);
  119.